Optimal. Leaf size=126 \[ -\frac{b^3 \sin (e+f x)}{2 a^3 f (a+b) \left (-a \sin ^2(e+f x)+a+b\right )}+\frac{b^2 (6 a+5 b) \tanh ^{-1}\left (\frac{\sqrt{a} \sin (e+f x)}{\sqrt{a+b}}\right )}{2 a^{7/2} f (a+b)^{3/2}}+\frac{(a-2 b) \sin (e+f x)}{a^3 f}-\frac{\sin ^3(e+f x)}{3 a^2 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.155194, antiderivative size = 126, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {4147, 390, 385, 208} \[ -\frac{b^3 \sin (e+f x)}{2 a^3 f (a+b) \left (-a \sin ^2(e+f x)+a+b\right )}+\frac{b^2 (6 a+5 b) \tanh ^{-1}\left (\frac{\sqrt{a} \sin (e+f x)}{\sqrt{a+b}}\right )}{2 a^{7/2} f (a+b)^{3/2}}+\frac{(a-2 b) \sin (e+f x)}{a^3 f}-\frac{\sin ^3(e+f x)}{3 a^2 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4147
Rule 390
Rule 385
Rule 208
Rubi steps
\begin{align*} \int \frac{\cos ^3(e+f x)}{\left (a+b \sec ^2(e+f x)\right )^2} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^3}{\left (a+b-a x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{a-2 b}{a^3}-\frac{x^2}{a^2}+\frac{b^2 (3 a+2 b)-3 a b^2 x^2}{a^3 \left (a+b-a x^2\right )^2}\right ) \, dx,x,\sin (e+f x)\right )}{f}\\ &=\frac{(a-2 b) \sin (e+f x)}{a^3 f}-\frac{\sin ^3(e+f x)}{3 a^2 f}+\frac{\operatorname{Subst}\left (\int \frac{b^2 (3 a+2 b)-3 a b^2 x^2}{\left (a+b-a x^2\right )^2} \, dx,x,\sin (e+f x)\right )}{a^3 f}\\ &=\frac{(a-2 b) \sin (e+f x)}{a^3 f}-\frac{\sin ^3(e+f x)}{3 a^2 f}-\frac{b^3 \sin (e+f x)}{2 a^3 (a+b) f \left (a+b-a \sin ^2(e+f x)\right )}+\frac{\left (b^2 (6 a+5 b)\right ) \operatorname{Subst}\left (\int \frac{1}{a+b-a x^2} \, dx,x,\sin (e+f x)\right )}{2 a^3 (a+b) f}\\ &=\frac{b^2 (6 a+5 b) \tanh ^{-1}\left (\frac{\sqrt{a} \sin (e+f x)}{\sqrt{a+b}}\right )}{2 a^{7/2} (a+b)^{3/2} f}+\frac{(a-2 b) \sin (e+f x)}{a^3 f}-\frac{\sin ^3(e+f x)}{3 a^2 f}-\frac{b^3 \sin (e+f x)}{2 a^3 (a+b) f \left (a+b-a \sin ^2(e+f x)\right )}\\ \end{align*}
Mathematica [A] time = 1.15593, size = 139, normalized size = 1.1 \[ \frac{a^{3/2} \sin (3 (e+f x))-\frac{3 b^2 (6 a+5 b) \left (\log \left (\sqrt{a+b}-\sqrt{a} \sin (e+f x)\right )-\log \left (\sqrt{a+b}+\sqrt{a} \sin (e+f x)\right )\right )}{(a+b)^{3/2}}+3 \sqrt{a} \sin (e+f x) \left (-\frac{4 b^3}{(a+b) (a \cos (2 (e+f x))+a+2 b)}+3 a-8 b\right )}{12 a^{7/2} f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.101, size = 120, normalized size = 1. \begin{align*}{\frac{1}{f} \left ( -{\frac{1}{{a}^{3}} \left ({\frac{a \left ( \sin \left ( fx+e \right ) \right ) ^{3}}{3}}-\sin \left ( fx+e \right ) a+2\,\sin \left ( fx+e \right ) b \right ) }-{\frac{{b}^{2}}{{a}^{3}} \left ( -{\frac{\sin \left ( fx+e \right ) b}{ \left ( 2\,a+2\,b \right ) \left ( -a-b+a \left ( \sin \left ( fx+e \right ) \right ) ^{2} \right ) }}-{\frac{6\,a+5\,b}{2\,a+2\,b}{\it Artanh} \left ({\sin \left ( fx+e \right ) a{\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ){\frac{1}{\sqrt{ \left ( a+b \right ) a}}}} \right ) } \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 0.651429, size = 1077, normalized size = 8.55 \begin{align*} \left [\frac{3 \,{\left (6 \, a b^{3} + 5 \, b^{4} +{\left (6 \, a^{2} b^{2} + 5 \, a b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sqrt{a^{2} + a b} \log \left (-\frac{a \cos \left (f x + e\right )^{2} - 2 \, \sqrt{a^{2} + a b} \sin \left (f x + e\right ) - 2 \, a - b}{a \cos \left (f x + e\right )^{2} + b}\right ) + 2 \,{\left (4 \, a^{4} b - 4 \, a^{3} b^{2} - 23 \, a^{2} b^{3} - 15 \, a b^{4} + 2 \,{\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} \cos \left (f x + e\right )^{4} + 2 \,{\left (2 \, a^{5} - a^{4} b - 8 \, a^{3} b^{2} - 5 \, a^{2} b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sin \left (f x + e\right )}{12 \,{\left ({\left (a^{7} + 2 \, a^{6} b + a^{5} b^{2}\right )} f \cos \left (f x + e\right )^{2} +{\left (a^{6} b + 2 \, a^{5} b^{2} + a^{4} b^{3}\right )} f\right )}}, -\frac{3 \,{\left (6 \, a b^{3} + 5 \, b^{4} +{\left (6 \, a^{2} b^{2} + 5 \, a b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sqrt{-a^{2} - a b} \arctan \left (\frac{\sqrt{-a^{2} - a b} \sin \left (f x + e\right )}{a + b}\right ) -{\left (4 \, a^{4} b - 4 \, a^{3} b^{2} - 23 \, a^{2} b^{3} - 15 \, a b^{4} + 2 \,{\left (a^{5} + 2 \, a^{4} b + a^{3} b^{2}\right )} \cos \left (f x + e\right )^{4} + 2 \,{\left (2 \, a^{5} - a^{4} b - 8 \, a^{3} b^{2} - 5 \, a^{2} b^{3}\right )} \cos \left (f x + e\right )^{2}\right )} \sin \left (f x + e\right )}{6 \,{\left ({\left (a^{7} + 2 \, a^{6} b + a^{5} b^{2}\right )} f \cos \left (f x + e\right )^{2} +{\left (a^{6} b + 2 \, a^{5} b^{2} + a^{4} b^{3}\right )} f\right )}}\right ] \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.15722, size = 205, normalized size = 1.63 \begin{align*} \frac{\frac{3 \, b^{3} \sin \left (f x + e\right )}{{\left (a^{4} + a^{3} b\right )}{\left (a \sin \left (f x + e\right )^{2} - a - b\right )}} - \frac{3 \,{\left (6 \, a b^{2} + 5 \, b^{3}\right )} \arctan \left (\frac{a \sin \left (f x + e\right )}{\sqrt{-a^{2} - a b}}\right )}{{\left (a^{4} + a^{3} b\right )} \sqrt{-a^{2} - a b}} - \frac{2 \,{\left (a^{4} \sin \left (f x + e\right )^{3} - 3 \, a^{4} \sin \left (f x + e\right ) + 6 \, a^{3} b \sin \left (f x + e\right )\right )}}{a^{6}}}{6 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]